﻿using System;
using System.Security.Cryptography;
using System.Text;
public partial class upload : BasePage
{
    static readonly SHA1CryptoServiceProvider osha1 = new SHA1CryptoServiceProvider();
    protected void Page_Load(object sender, EventArgs e)
    {


    }





}


public class UploadProgress
{
    public string UID { get; set; }
    public string FileID { get; set; }
    public string WrittenSize { get; set; }
    public string TotalSize { get; set; }
    public string FileName { get; set; }
    public string Progress { get; set; }
    public string Time { get; set; }
    public string Speed { get; set; }
    public bool Done { get; set; }

    public string ToJson()
    {
        StringBuilder builder = new StringBuilder("{");
        builder.AppendFormat("uid: \"{0}\",", UID);
        builder.AppendFormat("fileid: \"{0}\",", FileID);
        builder.AppendFormat("wsize: \"{0}\",", WrittenSize);
        builder.AppendFormat("tsize: \"{0}\",", TotalSize);
        builder.AppendFormat("filename: \"{0}\",", FileName);
        builder.AppendFormat("progress: \"{0}\",", Progress);
        builder.AppendFormat("time: \"{0}\",", Time);
        builder.AppendFormat("speed: \"{0}\",", Speed);
        builder.AppendFormat("done: {0}", Done ? "true" : "false");
        builder.Append("}");
        return builder.ToString();
    }
}